﻿<%@ Page Title="大学生健康辅助监控系统" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <!-- 可以添加头部脚本或样式 -->
<style>
/* 页面背景 */
body {
    background-color: #f3f6fb;
    font-family: "微软雅黑", sans-serif;
}

/* 标题样式 */
h2 {
    color: #4a148c;
    font-weight: 700;
    font-size: 1.8em;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 30px;
}

/* 使搜索容器居中 */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* 调整搜索框和按钮之间的间距 */
    margin-bottom: 20px;
}

/* 搜索框样式 */
.search-box {
    padding: 8px 16px;
    border: 1px solid #d1d1d1;
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s;
}

.search-box:focus {
    border-color: #4a90e2;
}

/* 搜索按钮样式 */
.search-button {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.search-button:hover {
    background: linear-gradient(to right, #357abd, #2c5d9e);
}



/* 主表样式 */
.grid-view {
    border: none;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

.grid-view table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
}

.grid-view th {
    background-color: #6a5acd;
    color: white;
    padding: 15px;
    border-radius: 0;
    font-size: 16px;
}

.grid-view td {
    background-color: white;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 15px;
    transition: background-color 0.3s ease;
}

.grid-view td:hover {
    background-color: #f7f8fc;
}

.grid-view a {
    color: #6a5acd;
    text-decoration: none;
    font-weight: bold;
}

/* 从表样式 */
.details-view {
    border: none;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 20px;
    background-color: white;
    margin-top: 20px;
}

.details-view th {
    background-color: #6a5acd;
    color: white;
    font-weight: bold;
    padding: 12px;
    border: none;
    font-size: 15px;
}

.details-view td {
    padding: 12px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.details-view td:hover {
    background-color: #f7f8fc;
}

</style>


</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
      <h2>欢迎来到大学生健康辅助监控系统</h2>

<div class="search-container">
    <asp:TextBox ID="txtSearch" runat="server" CssClass="search-box" placeholder="请输入关键词"></asp:TextBox>
    <asp:Button ID="btnSearch" runat="server" CssClass="search-button" Text="搜索" OnClick="btnSearch_Click" />
</div>





    <div class="leftside grid-view">
        <asp:GridView ID="gvElderInfo" runat="server" AutoGenerateColumns="False" AllowPaging="False"
                      DataKeyNames="old_id" OnSelectedIndexChanged="gvElderInfo_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="old_id" HeaderText="老人ID" />
                <asp:BoundField DataField="old_name" HeaderText="姓名" />
                <asp:BoundField DataField="old_性别" HeaderText="性别" />
                <asp:BoundField DataField="datebirth" HeaderText="出生日期" DataFormatString="{0:yyyy-MM-dd}" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbDetails" runat="server" CommandName="Select" Text="详细资料"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>

    <asp:LinqDataSource ID="ldsElderInfo" runat="server" ContextTypeName="Elderlyhealth.DAL.DataClasses1DataContext" 
                        TableName="Tolder老人" Where="old_name.Contains(@search)" 
                        Select="new (old_id, old_name, old_性别, datebirth)">
        <WhereParameters>
            <asp:ControlParameter ControlID="txtSearch" Name="search" PropertyName="Text" Type="String" DefaultValue="" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <!-- 右侧内容区域 -->
    <div class="rightside details-view">
        <asp:DetailsView ID="dvHealthData" runat="server" AutoGenerateRows="True" Visible="false">
        </asp:DetailsView>
        
        <asp:LinqDataSource ID="ldsHealthData" runat="server" ContextTypeName="Elderlyhealth.DAL.DataClasses1DataContext" 
                            TableName="Theath健康数据" EnableDelete="False" EnableInsert="False" EnableUpdate="False">
        </asp:LinqDataSource>
    </div>


</asp:Content>
